import Vue from 'vue'
import Vuex from 'vuex'

import cart from './modules/cart'
import cate from './modules/category'
import cate2 from './modules/category2'
import brand from './modules/brand'
import brand2 from './modules/brand2'
import product from './modules/product'
import productDetail from './modules/productDetail'
import productListTop from './modules/productListTop'
import actions from './actions'
import mutations from './mutations'
import state from './state'


Vue.use(Vuex)

const store = new Vuex.Store({
  actions,
  mutations,
  state,
  modules: {
    cart: {
      namespaced: true,
      ...cart
    },
    cate: {
      namespaced: true,
      ...cate
    },
    brand: {
      namespaced: true,
      ...brand
    },
    cate2: {
      namespaced: true,
      ...cate2
    },
    brand2: {
      namespaced: true,
      ...brand2
    },
    product: {
      namespaced: true,
      ...product
    },
    productDetail: {
      namespaced: true,
      ...productDetail
    },
    productListTop: {
      namespaced: true,
      ...productListTop
    }
  }
})

export default store
